<?php 

$sober = file("stat.txt"); 

$dphi=explode("|",$sober[0]);

$point_signup=$dphi[0];

$p_p_v= $dphi[1];

$p_p_v_r= ($dphi[4]/100)*($dphi[1]);

$p_p_r=$dphi[3];

$sec_surf=$dphi[2];

$table_color=$dphi[5];

$td_color =$dphi[6];

$heading_color =$dphi[7];

$heading_text=$dphi[8];


$date=time(); 

$day =date("D d"); 

$month =date("M"); 

$year =date("Y"); 

$dt="$day-$month-$year"; 

if($action == "signup") {

if($ref!=""){

$user = file("g_file.php");

for($x=0;$x<sizeof($user);$x++) { 

$temp = explode(";",$user[$x]); 

$opp[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];";

$fre=base64_decode($temp[0]);

if($ref==$fre && $temp[8]=="active"){

$list[0] = $opp[$x]; 

} 

}

if(sizeof($list)!="0"){

$referer="Refered by <B>$ref</B>";

$polic=$ref;

}else{

$polic="";

}

}

echo "<form method='post' action='?action=join&ref=$polic'><table width=80% border=0 cellspacing=0 cellpadding='0'><tr><td></td><td><FONT SIZE=3 color=#FF9900><B>Signup and get $dphi[0] Hits</B></FONT><BR><BR></td></tr><tr><td width=10 ><font size=-1>Username:</font></td><td><input type=text name=name size=20>Only numbers or small letters</td></tr><tr><td width=10%>Password:</td><td><input type=password name=password ></td></tr><td width=5><font size=-1>Email:</font></td><td width=14%><input type=text name=email size=20>Verification will be send to your email</td></tr><tr><td width=5><font size=-1>URL:</font></td><td width=50%><input type=hidden name=refe value=$polic><input type=text name=url size=20 value=http://>Website at which you want to receive hits.</td></tr><tr><td></td><td>$referer</td></tr><tr><td></td> <td><BR>Your Website should satisfy <A HREF=?action=terms target='_blank'>Terms and Conditions</A></td></tr><tr><td></td><td><BR><input type=submit name=submit value=Submit></td></tr></table></form>";

} 

$db_file = "g_file.php"; 

$pcount=sizeof($db_file); 

$lines = file($db_file); 

$a = count($lines); 

$stat="0"; 

if($action == "join") {

$name=strtolower($name);

$email=strtolower($email);

$url=strtolower($url);

$user = file("g_file.php");

$lis = 0;

$specialchar1 = (substr_count($name,"/"));

$specialchar2 = (substr_count($name,";"));

$specialchar3 = (substr_count($name," "));

$specialchar4 = (substr_count($name,"<"));

$specialchar5 = (substr_count($name,">"));

$specialchar6 = (substr_count($name,"*"));

$specialchar7 = (substr_count($name,"?"));

$specialchar8 = (substr_count($name,":"));

$specialchar9 = (substr_count($name,"|"));

$specialchar10 = (substr_count($name,"!"));

if(strlen($name) <= 2){ 

    print "<p><BR><BR><BR><b>Your username must be longer than 2 characters</b><br><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><BR><BR><BR>"; 

} 

elseif(strlen($password) <= 2){ 

    print "<p><BR><BR><BR><b>Your Password must be longer than 2 characters</b><br><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><BR><BR><BR>"; 

} 

elseif(strlen($email) <= 2){ 

    print "<p><BR><BR><BR><b>Your email must be Valid</b><br><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><BR><BR><BR>"; 

} 

elseif(strlen($url) <= 10){ 

    print "<p><BR><BR><BR><b>Your URL must be Valid</b><br><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><BR><BR><BR>"; 

}

elseif($specialchar1!="0"){

echo "Your username contains illegal character.";

}elseif($specialchar2!="0"){

echo "Your username contains illegal character.";

}

elseif($specialchar3!="0"){

echo "No spaces are allowed in your username.";

}

elseif($specialchar4!="0"){

echo "Your username contains illegal character.";

}

elseif($specialchar5!="0"){

echo "Your username contains illegal character";

}

elseif($specialchar6!="0"){

echo "Your username contains illegal character";

}

elseif($specialchar7!="0"){

echo "Your username contains illegal character";

}

elseif($specialchar8!="0"){

echo "Your username contains illegal character";

}

elseif($specialchar9!="0"){

echo "Your username contains illegal character";

}

elseif($specialchar10!="0"){

echo "Your username contains illegal character";

}

elseif(substr($url, 0, 7 )!="http://"){

echo "Your website url must begin with http://";

}



else{

for($x=0;$x<sizeof($user);$x++) { 

$temp = explode(";",$user[$x]); 

$opp[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];"; 

$meta = base64_encode($name); 

$meta2 =$temp[0];

$vref=$temp[7];

if(strlen($ref)>="2"){

$ppt=$ref;

$referer="Refered by <B>$ppt</B>";

}

if($meta==$meta2) { 

$list[0] = $opp[$x]; 

}

elseif(base64_encode($email)==$temp[2]){ 

$list1[0] = $opp[$x]; 

}

}

if(sizeof($list) != "0") {

echo "<font face=arial color=red><b>Username already exists please choose another username.</font><BR><BR>"; 

echo "<form method='post' action='?action=join&ref=$ppt'><table width=80% border=0 cellspacing=0 cellpadding='0'><tr><td></td><td><FONT SIZE=2 class=copyright color=#AFC6DE>Signup and get $dphi[0] Hits</FONT><BR><BR></td></tr><tr><td width=10 ><font size=-1>Username:</font></td><td width=187><input type=text name=name size=20></td></tr><tr><td width=10%>Password:</td><td><input type=password name=password ></td></tr><td width=5><font size=-1>Email:</font></td><td width=14%><input type=text name=email size=20>Verification link will be send to your email</td></tr><tr><td width=5><font size=-1>URL:</font></td><td width=50%><input type=hidden name=refe value=$ppt><input type=text name=url size=20 value=http://>Website at which you want to get hits.</td></tr><tr><td></td><td>$referer</td></tr><tr><td></td> <td>Your Website should satisfy <A HREF=?action=terms>Terms and Conditions</A></td></tr><tr><td></td><td><input type=submit name=submit value=Submit></td></tr></table></form>";

}

elseif(sizeof($list1) != "0") {

echo "<font face=arial color=red><b>Our records shows that this email is already in use</b></font><BR><BR>"; 

echo "<form method='post' action='?action=join&ref=$ppt'><table width=80% border=0 cellspacing=0 cellpadding='0'><tr><td></td><td><FONT SIZE=2 class=copyright color=#AFC6DE>Signup and get $dphi[0] Hits</FONT><BR><BR></td></tr><tr><td width=10 ><font size=-1>Username:</font></td><td width=187><input type=text name=name size=20></td></tr><tr><td width=10%>Password:</td><td><input type=password name=password ></td></tr><td width=5><font size=-1>Email:</font></td><td width=14%><input type=text name=email size=20>Verification will be send to your email</td></tr><tr><td width=5><font size=-1>URL:</font></td><td width=50%><input type=hidden name=refe value=$ppt><input type=text name=url size=20 value=http://> Website at which you want to get hits.</td></tr><tr><td></td><td>$referer</td></tr><tr><td></td> <td>Your Website should satisfy <A HREF=?action=terms>Terms and Conditions</A></td></tr><tr><td></td><td><input type=submit name=submit value=Submit></td></tr></table></form>";

}else{

$pr=time();

$lines = file("g_file.php");

if (filesize("g_file.php")<=15){

$den="1"; }else{

$den = count($lines);

}

$url = str_replace (";","&", $url);

$fp = fopen ("g_file.php", "a+");

fwrite ($fp, "\n"); 

fwrite ($fp, base64_encode($name)); 

fwrite ($fp, ";"); 

fwrite ($fp, md5($password)); 

fwrite ($fp, ";"); 

fwrite ($fp, base64_encode($email)); 

fwrite ($fp, ";"); 

fwrite ($fp, $url); 

fwrite ($fp, ";"); 

fwrite ($fp, $point_signup); 

fwrite ($fp, ";"); 

fwrite ($fp, $a); 

fwrite ($fp, ";"); 

fwrite ($fp, $stat); 

fwrite ($fp, ";");

fwrite ($fp, $refe); 

fwrite ($fp, ";"); 

fwrite ($fp, "inactive"); 

fwrite ($fp, ";"); 

fwrite ($fp, $pr); 

fwrite ($fp, ";");

fwrite ($fp, $den); 

fwrite ($fp, ";"); 

fclose ($fp);

$name= str_replace ("/","", $name);

$name= str_replace ("\'","", $name);

$name= str_replace ('|',"", $name);

$name= str_replace ('?',"", $name);

$name= str_replace ('<',"", $name);

$name= str_replace ('*',"", $name);

$name= str_replace ('>',"", $name);

$name= str_replace (':',"", $name);

$f = fopen ("u_files/".$name.".txt", "w"); 

fwrite ($f,$point_signup); 

fclose ($f); 

$g = fopen ("u_files/".$name."_rotate.txt", "w"); 

fclose ($g); 

$h = fopen ("u_files/".$name."_rotate1.txt", "w"); 

fwrite ($h, "$url myid=$name myid=" ); 

fwrite ($h,"\n"); 

fclose ($h);

$link1=getenv(HTTP_HOST);

$link2=${PHP_SELF};

$link="http://$link1$link2?action=verify&name=$name&bh=$pr";

$to=$email;

$subject="Your Verification Link";

$mess = "Hi $name1\n In order to verify your account please click the link below:\n $link\n"; 

$mailheaders="Return-path: info@bucketsofads.com\n"; 

$mailheaders.="From: info@bucketsofads.com\n"; 

$mailheaders.="Reply-To: info@bucketsofads.com\n"; 

$sent=mail(trim($to), $subject, $mess, $mailheaders);

if($sent){

echo "<p><b>A verification link has been sent to your email address.<BR>Your account will be verified after clicking on that verification link.<BR>NOTE: Your account verification link expires after one week, so you must verify your account within one week, or else you will have to signup again.<BR>"; 

}else{echo"Please check that you have provided the correct email address, we are unable to send the verification link to the email you specified.";}

} 

} 

}

if($action=="verify"){

$filename="g_file.php";

$found=0;

$mime=base64_encode($name);

$array=file("g_file.php");

$pari=$array;

for($x=0;$x<sizeof($array);$x++) {	

$temp = explode(";",$array[$x]);

if($temp[0]!=$mime && strlen($temp[0])>=2){

$line[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];";

}elseif($temp[0]==$mime && strlen($temp[1])>=2){

$line[$x]="$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];active;$temp[9];$temp[10];";

$found=1;

}

}

$fp = fopen ("$filename", "w");

for($i=0; $i<sizeof($pari);$i++){			

if(strlen($line[$i])>=2){

fwrite ($fp, $line[$i]);

fwrite ($fp, "\n");

}else{

continue;

}

}

fclose ($fp);

if($found==1){

print "<p><p>Your account has been verified<br><br><form method=post action=?action=login><input type=submit value=Login ></form>";

}else{

echo "Your account could not be verified, please check that you have entered the correct url.";

}

}

if($action == "login"){ 

echo"<FONT SIZE=3 COLOR=#FF9900><B>Members Login:</B></FONT><BR>"; 

login(); 

} 

if($action == ""){ 

echo "<H3>Get visitors to your website<BR>Its free and easy!</H3>"; 

//login(); 

} 

if($action == "dologin"){

$user = file("g_file.php");

$vi1=base64_decode($vi);

if(strlen($name) <= 2 && strlen($vi)<="2"){ 

print "<p><BR><BR><BR><b>Your username must be longer than 2 characters</b><br><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><BR><BR><BR>"; 

}else{ 

for($x=0;$x<sizeof($user);$x++) { 

$temp = explode(";",$user[$x]); 

$opp[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];";

$meta = base64_encode($name); 

$meta2 =$temp[0]; 

$aq= md5($password); 

$ap =$temp[1];

if($aq==$ap && $meta==$meta2 && $temp[8]=="active") { 

$list[0] = $opp[$x]; 

$list1[0] = $opp[$x]; 

}

elseif($aq==$ap && $meta==$meta2 && $temp[8]=="inactive"){

echo "Your account is not yet verified.<BR>Please check your mail box, you should have received our email with the verification link.<BR>";

}

if(strlen($vi1)>="3"&&$vi1==$ap){

$list[0] = $opp[$x]; 

$list1[0] = $opp[$x]; 

}

} 

if(sizeof($list) != "0" && sizeof($list1) != "0") { 

for($y=0;$y<sizeof($list);$y++) { 

$temp = explode(";",$list[$y]);

$m=base64_encode($temp[1]);

if ($temp[6]!=0){ 

$p="<td>Your URL is activated <A HREF=?action=change&id=$temp[10]&m=$m>Deactivate</a></td>"; 

}elseif($temp[6]=="fired"){ 

$p="<td>Your URL has been Deactivated<BR> (<FONT COLOR=red>Due to violation of Terms/Error in your website</FONT>) <A HREF=?action=change&id=$temp[10]&m=$m>Activate</a></td>"; 

} 

elseif($temp[6]==0){ 

$p="<td>Your URL is <font color=red>Deactivated</font> <A HREF=?action=change&id=$temp[10]&m=$m>Activate</a></td>"; 

} 

$use = file("u_files/".base64_decode($temp[0]).".txt"); 

for($x=0;$x<sizeof($use);$x++) { 

$em = explode("|",$use[$x]); 

}

$link1=getenv(HTTP_HOST);

$link2=$_SERVER["PHP_SELF"];

$j=base64_decode($temp[0]);

$link="http://$link1$link2?action=signup&ref=$j";

$n=base64_encode($temp[0]);

echo "<table width=100%><tr><td>Welcome $j</td></tr><tr><td>URL: $temp[3] <A HREF=?action=change&id=$temp[10]&m=$m><FONT SIZE=2 COLOR=green>Change</FONT></A></td></tr><tr><td>You have $em[0] Points.</td></tr><tr>$p</tr><tr><td>You can gain points by surfing:</td></tr><tr><td><A HREF=main.php?action=surf&name=$j target=cons723><FONT SIZE=2 COLOR=green>Click Here To start Surfing</FONT></A></td></tr><tr><td><A HREF=?action=see_ref&m=$m&n=$n>See Your Referers</A></td></tr><tr><td>Your referal link is: $link</td></tr><tr><td><a href=?action=logout>Logout</a></td></tr></table>"; 

} 

}else{ 

echo "<FONT SIZE=2 COLOR=red face=arial>Login Incorrect</FONT>"; 

login(); 

} 

} 

}

if($action=="see_ref"){

$l=base64_decode($n);

$yogi=base64_decode($l);

if (strlen($m)>="3"&&strlen($n)>="3"){

$user = file("g_file.php");

$pis="0";

for($x=0;$x<sizeof($user);$x++) { 

$gemp = explode(";",$user[$x]); 

$opp[$x] = "$gemp[0];$gemp[1];$gemp[2];$gemp[3];$gemp[4];$gemp[5];$gemp[6];$gemp[7];$gemp[8];$gemp[9];$gemp[10];"; 

if($yogi=="$gemp[7]" && $gemp[8]=="active"){

$list12[$pis] = $opp[$x];

$pis++;

} 

}

if(sizeof($list12)!="0"){

$hp=sizeof($list12);

if(sizeof($list12)=="1"){$spell="user";}else{$spell="users";}

echo "You have refered $hp $spell:<br>";

for($y=0;$y<sizeof($list12);$y++){

$gigi=explode(";",$list12[$y]);

$hoppy=base64_decode($gigi[0]);

echo "<li>$hoppy<BR>";

}

}else{

echo "No user has been refered by you<BR>You get <B>$p_p_r</B> Points for refering others and get <B>$dphi[4]%</B> points of your referer, earned by surfing.<BR>";

}

echo "<A HREF=javascript:history.back();>Back To Main</A>";

}else{

echo "Please Login";

}

}

if($action=="logout"){ 

echo "You loged out.<br>"; 

login(); 

} 

function login(){ 

?> 

<br><form method=post action=?action=dologin> 

<table width=80% border=0 cellspacing=0 cellpadding=0> 

<tr> 

<td width=14% >Username:</td> 

<td width=187> 

<input type=text name=name size=20> 

</td> 

</tr><tr><td width=14%> 

Password:</td><td><input type=password name=password ></td></tr> 

<tr> 

<td width=59></td> 

<td> 

<input type=submit name=submit value=Submit> 

</td> 

</tr> 

<td><A HREF="?action=signup">Join</A></td> 

</table> 

</form> 

<?php 

}

if ($action=="rotator"){ 

?> 

<HTML><HEAD> 

<META http-equiv=Content-Type content="text/html; charset=windows-1252"> 

<STYLE type=text/css>A:link { 

    COLOR: #6666ff; FONT-SIZE: 13px; FONT-WEIGHT: normal; TEXT-DECORATION: none 

} 

A:visited { 

    COLOR: #005177; FONT-SIZE: 13px; FONT-WEIGHT: normal; TEXT-DECORATION: none 

} 

A:hover { 

    COLOR: #cc3333; FONT-SIZE: 13px; TEXT-DECORATION: none 

} 

TD { 

    COLOR: #000000; FONT-FAMILY: Verdana, Helvetica, Arial; FONT-SIZE: 11px 

} 

</STYLE> 

<SCRIPT language=JavaScript type=text/javascript> 

var Zeit = '<?php echo $sec_surf; ?>'; 

var durch = 0; 

function doTime() 

{if(document.formular.pause.checked==false){ 

if (Zeit >= 0) { 

Zeit--; 

document.formular.count.value = Zeit; 

aktiv = setTimeout('doTime()', 1000);} 

else clearTimeout(aktiv); 

if (Zeit == 0) { 

durch++; 

if (durch == 1000){ 

window.location.reload() 

} 

parent.location.reload() 

Zeit = '<?php echo $sec_surf; ?>'; 

}; 

}else aktiv=setTimeout('doTime()',1000);} 

</SCRIPT> 

</HEAD> 

<BODY text=#000000 bgColor=#AFC6DB leftMargin=0 topMargin=0 onload=doTime() 

MARGINHEIGHT="0" MARGINWIDTH="2"> 

<?php

echo "<td><table width=100%><td><a target=_blank href=\"?action=report&url=$url&u=$name\">Report Abuse</a></td> <td> "; 

echo " <a target='_blank' href='$url'>Open in a new window</a></td><tr>"; 

$lpo =file ("u_files/".$name.".txt"); 

$lav = explode("|",$lpo[0]); 

?> 

<TD> 

<FORM name=formular> 

<FONT face="Verdana, Arial, Helvetica, sans-serif" 

size=1>Receive <?php echo $p_p_v; ?> points in <INPUT size=2 name=count readonly='TRUE' style='BORDER-WIDTH:0px;BACKGROUND:#AFC6DB;'>Sec. </FONT> 

<INPUT type=checkbox value=ON name=pause><FONT 

face="Verdana, Arial, Helvetica, sans-serif" size=1>stop Counter 

</FONT></td> 

<?php echo "<td>You Have <b>$lav[0]</b> Points.</td></table>"; 

?> 

</FORM> 

</BODY></HTML> 

<?php 

} 

if($action == "surf"){ 

$user = file("g_file.php"); 

$nouveau_compteur=fopen("u_files/".$name."_rotate.txt", "w");  

$lis = 0; 

for($x=0;$x<sizeof($user);$x++) { 

$temp = explode(";",$user[$x]); 

$opp[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];"; 

//$such = substr($temp[4],$keyword); 

if($temp[3]!="" && $temp[1]!="" && $temp[2]!="") { 

$list[$lis] = $opp[$x]; 

$lis++;  

} 

if(sizeof($list) != "0") { 

$fip = file("u_files/".$name.".txt"); 

for($i = 0; $i <sizeof($fip);$i++){ 

$fp = explode("|",$fip[$i]); 

} 

$size="u_files/".base64_decode($temp[0]).".txt"; 

$a="$size"; 

if(file_exists($a)){

$fpy = file($a);

for($m=0;$m <sizeof($a);$m++){ 

$fw = explode("|",$fpy[$m]); 

}

}

if ($temp[6] == "1" && $fw[0] >= "1"){ 

$fpq = fopen ("u_files/".$name."_rotate.txt", "a+"); 

fwrite ($fpq, $temp[3]); 

fwrite ($fpq, " myid="); 

fwrite ($fpq, base64_decode($temp[0])); 

fwrite ($fpq, " myid="); 

fwrite ($fpq, "\n"); 

fclose ($fpq); 

} 

} 

} 

if ($fp[1]<=$date-($sec_surf-"1")){ 

$fq = fopen ("u_files/".$name.".txt", "w"); 

fwrite ($fq, $fp[0]+$p_p_v); 

fwrite ($fq, "|"); 

fwrite ($fq, $date); 

fclose ($fq);

if($temp[7]!=""){

if (file_exists("u_files/".$temp[7].".txt")){

$ref_pt=file("u_files/".$temp[7].".txt");

$fogi=explode("|",$ref_pt[0]);

$ttr=fopen ("u_files/".$temp[7].".txt","w");

fwrite($ttr,$fogi[0]+$p_p_v_r);

fwrite($ttr,"|");

fwrite($ttr,$fogi[1]);

fclose($ttr);

}

}

}else{ 

$fq = fopen ("u_files/".$name.".txt", "w"); 

fwrite ($fq, $fp[0]+"0"); 

fwrite ($fq, "|"); 

fwrite ($fq, $date); 

fclose ($fq); 

} 

$textfile ="u_files/".$name."_rotate.txt";  

$urls = file("$textfile"); 

$uu = rand(0,sizeof($urls)-1);

$no="$urls[$uu]"; 

$random = fopen ("u_files/".$name."_rotate1.txt", "w"); 

fwrite ($random, $no); 

fwrite ($random, "|"); 

fclose ($random); 



$ali =file ("u_files/".$name."_rotate1.txt"); 

for($z=0;$z<sizeof($ali)-1;$z++) {

$last = explode(" myid=",$ali[$z]);

//echo "$last[1]";

$combo = file("u_files/".$last[1].".txt"); 

$qwe=explode("|",$combo[0]);

if ($last[1]!=$name){ 

$lastfile = fopen ("u_files/".$last[1].".txt", "w"); 

fwrite ($lastfile, $qwe[0]-"1"); 

fwrite ($lastfile, "|");

fwrite ($lastfile, $qwe[1]);

fclose ($lastfile); 

} 

} 

$ficdest=explode(" myid=",$no);  

$myurl=$ficdest[0]; 

?><FRAMESET border=0 

frameSpacing=0 rows=55,* frameBorder=YES><FRAME border=0 name=top 

marginWidth=0 marginHeight=0 

src="main.php?action=rotator&url=<?php echo $myurl; ?>&name=<?php echo $name; ?>" 

noResize scrolling=no leftmargin="0" topmargin="0"><FRAME border=0 

name=main marginWidth=0 marginHeight=0 

src="<?php echo"$myurl";?>" 

noResize leftmargin="0" topmargin="0"></FRAMESET></HTML> 

<?php 

} 

if($action == "change") { 

$fnm = fopen("g_file.php", 'r'); 

$found=0;

$m1=base64_decode($m);

$array = file("g_file.php");  

for($x=0;$x<sizeof($array);$x++) { 

$temp = explode(";",$array[$x]); 

if($temp[1]==$m1){

$line[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];"; 

$found=1;

break;

}else{

continue;

}

}

if($found==1){

$mod = explode(";", $line[$x]);

echo "<table width=100%><form method=\"POST\" action=\"?action=change2\" method=\"post\">"; 

echo "<input type=\"hidden\" name=\"name\" value=\"$mod[0]\">"; 

echo "<input type=\"hidden\" name=\"password\" value=\"$mod[1]\">"; 

echo "<input type=\"hidden\" name=\"email\" value=\"$mod[2]\">"; 

echo "<tr><td>URL:</td><td><input type=\"text\" value=\"$mod[3]\" name=\"cat\" size=\"50\"></td><tr>"; 

echo "<input type=\"hidden\" name=\"no\" value=\"$mod[5]\">"; 

echo "<tr><td>Status:</td><td><select name=\"status\"><option value=1>Activate<option value=0>Deactivate</select><BR><BR></td></tr>"; 

echo "<input type=\"hidden\" name=\"points\" value=\"$mod[4]\">"; 

echo "<input type=\"hidden\" name=\"ref\" value=\"$mod[7]\">"; 

echo "<input type=\"hidden\" name=\"state\" value=\"$mod[8]\">"; 

echo "<input type=\"hidden\" name=\"pr1\" value=\"$mod[9]\">"; 

echo "<input type=\"hidden\" name=\"dn1\" value=\"$x\">"; 

echo "<tr><td></td><td><input type=\"submit\" value=\"Submit\"> "; 

echo "<input type=\"reset\" value=\"Reset\"></td></tr>"; 

echo "<input type=\"hidden\" name=\"id\" value=\"$id\">";

echo "<input type=\"hidden\" name=\"m\" value=\"$m\">"; 

echo "</form></table>"; 

}else{

echo"Please login again.";

}

}

if($action == "change2") { 

$fp = @fopen("g_file.php", 'r'); 

$array = explode("\n", fread($fp, filesize("g_file.php")));  

for($x=0;$x<sizeof($array);$x++) {     

$temp = explode(";",$array[$x]); 

$line[$x] = "$temp[0];$temp[1];$temp[2];$temp[3];$temp[4];$temp[5];$temp[6];$temp[7];$temp[8];$temp[9];$temp[10];"; 

}

$p=explode(";",$opp[$idt]);

$line[$dn1]= "$name;$password;$email;$cat;$points;$no;$status;$ref;$state;$pr1;$dn1;"; 

$fp = fopen ("g_file.php", "w"); 

for($i=0; $i<sizeof($line);$i++){

$ef=explode(";",$line[$i]);

if($i<(sizeof($line)-1)){

$ko="\n";

}else{

$ko="";

}

if(strlen($ef[0])>="3"){

fwrite ($fp, $line[$i]);

fwrite ($fp, $ko); 

}elseif(strlen($ef[0])<="0"){

fwrite ($fp, ";;;;;;;;;;");

fwrite ($fp, $ko); 

}

}

fclose ($fp);

$jl=base64_encode($password);

print "<p><p>Changes have been edited successfully<br><br><form method=post action=?action=dologin><input type=hidden name='vi' value='$jl'><input type=submit value=Home></form></A>"; 

} 

if ($action == "report"){ 

$find=0;

//$url=str_replace("|^|","&",$url);

$pr=file("g_file.php");

for($i=0;$i<sizeof($pr);$i++){

$wp=explode(";",$pr[$i]);

$xp=explode("&",$wp[3]);

if($xp[0]==$url){

$find=1;

break;

}else{

continue;

}

}

if($find=="1"){

$user=base64_decode($wp[0]);

$repfile = fopen ("report.txt", "a+"); 

fwrite ($repfile, "\n"); 

fwrite ($repfile, $url); 

fwrite ($repfile, "|"); 

fwrite ($repfile, $dt); 

fwrite ($repfile, "|"); 

fwrite ($repfile, $user); 

fwrite ($repfile, "|"); 

fwrite ($repfile, $u); 

fwrite ($repfile, "|"); 

fclose ($repfile); 

echo "Thank you for reporting abuse/error in this website."; 

}else{

echo "Sorry, there has been an error in reporting this website, please try again.";

}

}

if ($action=="referal_link"){

$imgn=getimagesize("banner.gif");

$link1=getenv(HTTP_HOST);

$link2=$_SERVER["PHP_SELF"];

$link="http://$link1$link2?action=signup&ref=your_username";

echo"<FONT SIZE=3 COLOR=$dphi[7]><B>Referal Link:</B></FONT><BR>Get <B>$p_p_r</B> Points for refering others and get <B>$dphi[4]%</B> points of your referer, earned by surfing.<BR><BR><FONT SIZE=3 COLOR=$dphi[7]><B>Banner Code:</B></font><BR><center><img src=banner.gif width=$imgn[0] height=$imgn[1]></img><BR><BR><textarea rows=3 cols=55><a href=$link target=_new><img src=banner.gif width=$imgn[0] height=$imgn[1] border=0></img></a></textarea></center><BR>Copy the code above and replace your_username with your own username.<BR><BR><FONT SIZE=3 COLOR=$dphi[7]><B>Simple Link:</B></font><BR><center><b><a href=$link>$link</a></b></center>";

}

if ($action==""){

echo"<font size=3><A HREF=?action=signup><font size=3><B>Join now</B></font></a> and get <B>$dphi[0]</B> hits for free + Receive <B>$dphi[1]</B> Points for each site you visit.<BR><B>1 point = 1</B> Hit to your website.<BR>Wait!!! there's lot more, Get <FONT SIZE=3><B>$dphi[3]</B></FONT> Points for each member you refer and get <B>$dphi[4] %</B> of what your referal earns by surfing.</font>";

}

if ($action=="terms"){

include "terms.txt";

}

if ($action=="faq"){

include "faq.txt";

}

if($action=="contact"){

echo "<H3>Contact Us:</H3><BR>";

include "mail.php";

}

?>               

